package com.ricchieri.dao;

import java.util.List;

import org.hibernate.Criteria;

import com.ricchieri.dao.interf.IUserRoleDao;
import com.ricchieri.filter.BasicFilter;
import com.ricchieri.model.UserRole;

public class UserRoleDao extends GenericDao implements IUserRoleDao {

	private static final long serialVersionUID = 2590004588918088332L;

	@Override
	@SuppressWarnings("unchecked")
	public List<UserRole> getAllUserRole(BasicFilter filter) {
		Criteria criteria = criteriaAllUserRole(filter);
		
		return criteria.list();
	}
	
	private Criteria criteriaAllUserRole(BasicFilter filter) {
		return super.criteriaAllBasic(filter, UserRole.class);
	}	

	@Override
	protected String getTableName() {
		return "userRole";
	}
}
